package com.whfc.emp.service.impl;

import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.whfc.common.exception.BizException;
import com.whfc.common.result.PageData;
import com.whfc.common.util.PageUtil;
import com.whfc.emp.dao.AppTrainUserAnswerMapper;
import com.whfc.emp.dao.AppTrainingUserProgressMapper;
import com.whfc.emp.dto.AppTrainingUserAnswerDTO;
import com.whfc.emp.dto.AppTrainingUserProgressDTO;
import com.whfc.emp.entity.AppTrainingUserAnswers;
import com.whfc.emp.param.AppTrainingAnswerAddParam;
import com.whfc.emp.param.AppTrainingEditParam;
import com.whfc.emp.param.AppTrainingListParam;
import com.whfc.emp.param.AppTrainingUserProgressListParam;
import com.whfc.emp.service.AppTrainingUserAnswerService;
import com.whfc.emp.service.AppTrainingUserProgressService;
import org.apache.dubbo.config.annotation.DubboService;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;

import java.util.List;

/**
 * @ClasssName AppTrainServiceImpl
 * @Description 人员管理-培训
 * @Author hw
 * @Date 2020/11/26 16:18
 * @Version 1.0
 */
@DubboService(interfaceClass = AppTrainingUserProgressService.class, version = "1.0.0", timeout = 5000)
public class AppTrainingUserProgressServiceImpl implements AppTrainingUserProgressService {

    private final Logger logger = LoggerFactory.getLogger(this.getClass());

    @Autowired
    private AppTrainingUserProgressMapper appTrainingUserProgressMapper;
    @Override
    public PageData<AppTrainingUserProgressDTO> list(AppTrainingUserProgressListParam request) throws BizException {
        PageHelper.startPage(request.getPageNum(), request.getPageSize());
        List<AppTrainingUserProgressDTO> list = appTrainingUserProgressMapper.selectByParam(request);
        PageHelper.clearPage();
        return PageUtil.pageData(PageInfo.of(list));
    }
}
